package net.fxug.hokuriku.chocolat.model
{
    import flash.errors.IllegalOperationError;

    /**
     * Applicationレベルでスコープ管理されるデータクラス。Singleton
     * WebでいうSession情報を想定。
     *
     * TODO Singletonで要実装
     * @author hikaruworld
     */
    public class ApplicationDataModel
    {
        private static var instance:ApplicationDataModel;

        [Bindalble]
        public var sessionId:int;

        public function ApplicationDataModel(blockr:SingletonBlockr = null)
        {
            if (blockr == null)
            {
                throw new IllegalOperationError("Can not create instance" /* TODO エラー処理 */);
            }
            trace("create instance..");
        }

        public static function getInstance():ApplicationDataModel
        {
            if (instance == null)
            {
                instance = new ApplicationDataModel(new SingletonBlockr());
            }
            return instance;
        }
    }
}

internal class SingletonBlockr
{
}